import 'package:flutter/material.dart';
import 'package:flare_flutter/flare_actor.dart';

Drawer createDrawer(BuildContext context) {
  return Drawer(
    child: Column(
      mainAxisAlignment: MainAxisAlignment.start,
      children: <Widget>[
        UserAccountsDrawerHeader(
          decoration: BoxDecoration(
            border: Border(
              bottom: BorderSide(
                color: Colors.black12,
                width: 1.0,
                style: BorderStyle.solid,
              ),
            ),
            color: Color.fromARGB(00, 0xe6, 0xe6, 0xe6),
          ),
          currentAccountPicture: Container(
            padding: EdgeInsets.all(0.0),
            height: 144.0,
            width: 144.0,
            decoration: BoxDecoration(
                shape: BoxShape.circle,
                border: Border.all(width: 3.0, color: Colors.grey[300])),
            child: new FlareActor(
              "assets/anima/minion.flr",
              fit: BoxFit.cover,
              animation: "Dance",
              isPaused: false,
              shouldClip: false,
              alignment: Alignment.center,
            ),
          ),
          accountName: Text(
            "username",
            style: TextStyle(color: Colors.black26, fontSize: 20.0),
          ),
          accountEmail: Text("data"),
          otherAccountsPictures: <Widget>[
            Stack(
              children: <Widget>[
                Positioned(
                  top: 20,
                  right: 20.0,
                  width: 80.0,
                  height: 80.0,
                  child: CircleAvatar(
                    child: Image.network(
                        "https://avatars2.githubusercontent.com/u/42227664?s=88&v=4"),
                  ),
                ),
              ],
            )
          ],
          onDetailsPressed: () {
            print("detail");
          },
        ),
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            FlatButton.icon(
                // 文本内容
                icon: Icon(Icons.add_circle, size: 25.0, color: Colors.black12),
                label: Text('嘿,历史', semanticsLabel: 'FLAT BUTTON 2'),
                onPressed: () {
                  Scaffold.of(context).showSnackBar(
                    SnackBar(
                      content: Text("this this snack bar"),
                      duration: Duration(seconds: 2),
                    ),
                  );
                }),
            FlatButton.icon(
                // 文本内容
                icon: Icon(Icons.add_circle, size: 25.0, color: Colors.black12),
                label: Text('好的', semanticsLabel: 'FLAT BUTTON 2'),
                onPressed: () {
                  Scaffold.of(context).showSnackBar(
                    SnackBar(
                      content: Text("this this snack bar"),
                      duration: Duration(seconds: 2),
                    ),
                  );
                }),
          ],
        ),
        Divider(height: 1.0 , color: Colors.black12,),
        ListTile(
          leading: Icon(Icons.http),
          trailing: Text(
            "data",
            style: TextStyle(fontSize: 14.0, color: Colors.black54),
          ),
          onTap: () {
            Scaffold.of(context).showSnackBar(SnackBar(
              content: Text("this this snack bar"),
              duration: Duration(seconds: 2),
            ));
          },
        ),
      ],
    ),
  );
}
